package mvc.model.service.impl;

import mvc.model.dao.CartDao;
import mvc.model.dao.impl.CartDaoImpl;
import mvc.model.pojos.CartBean;
import mvc.model.service.CartService;
import mvc.model.vo.Cart;

import java.util.List;

public class CartServiceImpl implements CartService {
    private static final CartDao cartDao;
    static {
        cartDao = new CartDaoImpl();
    }
    @Override
    public CartBean queryOne(int cartnumber) {
        return cartDao.queryOne(cartnumber);
    }

    @Override
    public List<CartBean> query(int uid) {
        return cartDao.query(uid);
    }

    @Override
    public Cart queryOneVO(int cartnumber) {
        return cartDao.queryOneVO(cartnumber);
    }

    @Override
    public List<Cart> queryVO(int uid) {
        return cartDao.queryVO(uid);
    }

    @Override
    public void upCart(CartBean cartBean, int cartnumber) {
        cartDao.upCart(cartBean, cartnumber);
    }

    @Override
    public void upCartAll(int uid, int checked) {
        cartDao.upCartAll(uid, checked);
    }

    @Override
    public List<Cart> queryChecked(int uid) {
        return cartDao.queryChecked(uid);
    }

    @Override
    public void addCart(CartBean cart) {
        cartDao.addCart(cart);
    }

    @Override
    public CartBean queryByPid(int pid, int uid) {
        return cartDao.queryByPid(pid, uid);
    }

}
